@import 'lib';

.listing-grid {
    li {
        overflow: visible;
        float: left;
        height: 66px;
    }
    &.cols-5 li { width: 100% / 5; }
    &.cols-4 li { width: 100% / 4; }
    &.cols-3 li { width: 100% / 3; }
    &.cols-2 li { width: 100% / 2; }
    &.cols-1 li { width: 100%; }
    section {
        display: none;
        position: relative;

        &:first-child {
            display: block;
        }
    }
}
.hovercard {
    position: relative;
    border: 1px solid transparent;
    z-index: 20;

    .more, .desc {
        font-family: @sans-stack;
        color: #333;
        font-size: 12px;
        z-index: 29;
        margin-top: 0;
    }
    .desc {
        max-height: 2.6em;
        overflow: hidden;
    }
    .install-shell {
        .eula, .contrib {
            font-size: 12px;
        }
        .extra {
            + .extra {
                margin: 0;
            }
            .notavail {
                margin: 0 0 2px;
            }
        }
    }
    h3 {
        color: @link;
        font-weight: bold;
        margin: 0 0 2px 0;
        font-size: 13px;
        line-height: 17px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 200px;
    }
    .more {
        display: none;
        position: relative;
        padding: 0 14px 8px 12px;

        p:first-child {
            margin-top: 0;
        }
    }
    a {
        text-decoration: none;
    }
    .adu {
        color: #390;
        font-size: 11px;
    }
    .byline {
        margin-top: 8px;
        font-size: 11px;
        font-style: italic;
        max-width: 220px;

        a {
            display: inline;
            color: inherit;
        }
    }
    &:hover {
        z-index: 25;
        background: #fff;
        border-color: #ccc;
        .box-shadow(2px 2px 6px -2px rgba(0,0,0,.4));
        .more {
            background: #fff;
            display: block;
            z-index: 28;
        }
        h3 {
            text-decoration: underline;
        }
    }
    &.addon .more .vitals,
    &.theme:hover .more + .vitals {
        border-top: 1px dotted #ccc;
        padding: 8px 0 0;
        margin: 8px 0 4px;
    }
    &.addon {
        margin: 5px 5px 5px 61px;

        .summary, .icon {
            position: relative;
            padding: 8px;
        }
        .summary {
            height: 55px;
            z-index: 21;
            overflow: hidden;

            div {
                white-space: nowrap;
            }
        }
        .icon {
            position: absolute;
            left: -57px;
            top: -1px;
            padding-right: 0;
            height: 48px;
            width: 48px;
            border-width: 1px 0 1px 1px;
            border-style: solid;
            z-index: 22;
            border-color: transparent;

            img {
                margin: 8px;
                max-width: 32px;
                max-height: 32px;
                border: 0;
                padding: 0;
            }
        }
        &:before {
            content: "";
            display: block;
            position: absolute;
            height: 66px;
            width: 56px;
            top: -1px;
            left: -57px;
            z-index: 1;
        }
        &:hover {
            float: left;
            z-index: 25;
            background: #fff;
            border-color: #ccc;
            .box-shadow(2px 2px 6px -2px rgba(0,0,0,.4));
            .summary {
                background: white;
                z-index: 26;
                height: auto;
                min-height: 48px;
            }
            .icon {
                background: #fff;
                border-color: #ccc;
                z-index: 27;
            }
            &:before {
                .box-shadow(2px 2px 6px -2px rgba(0,0,0,.4));
            }
        }
    }
    &.collection {
        &:hover {
            .summary {
                overflow: visible;
                height: auto;
            }
            .desc {
                overflow: visible;
                max-height: none;
            }
            .more {
                font-size: 11px;
                border-top: 1px dotted #CCCCCC;
                padding: 8px 0;
                margin: 0 8px;
                color: #390;
            }
        }
    }
    .category, .vital {
        color: #666;
        font-size: 11px;
        line-height: 10px;
        white-space: nowrap;
    }
    .summary .vital {
        margin-top: 4px;
        font-size: 10px;
        line-height: 12px;
    }
    .vital .price {
        color: @green;

        &:before {
            color: @note-gray;
            content: '\00B7';
        }
    }
}
.featured,
.theme-grid {
    h3 {
        font-size: 16px;
        line-height: 18px;
    }
    li {
        height: 212px;
        width: 240px;
    }
    .hovercard {
        padding: 9px 9px 11px;
        margin: 0;

        &.addon {
            &:before {
                display: none;
                content: none;
            }
            .summary {
                height: 192px;
                padding: 0;

                div {
                    width: 220px;
                    height: 170px;
                    position: relative;

                    img {
                        padding: 8px;
                        top: 0;
                        left: 0;
                        bottom: 0;
                        right: 0;
                        margin: auto;
                        border: 1px solid #ccc;
                        box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
                        position: absolute;
                    }
                }
            }
        }
        &:hover {
            &.addon .summary {
                height: auto;
            }
            .more {
                padding: 14px 0 0;
            }
        }
    }
}
.theme-grid {
    li {
        height: 205px;
        margin-bottom: 1em;
        width: 180px;
    }
    .incompatible {
        img {
            opacity: .4;
        }
        &:hover {
            img {
                opacity: 1;
            }
            > .notavail {
                display: none;
            }
        }
        > .notavail {
            color: @note-gray;
            display: block;
            font: 10px/10px Arial, sans-serif;
            margin-top: 8px;
        }
    }
    .hovercard.addon .summary {
        height: 157px;

        div {
            height: 135px;
            width: 160px;

            img {
                max-height: 108px;
                max-width: 142px;
            }
        }
    }
    .hovercard.addon > .vital {
        font-size: 11px;
        margin-top: 8px;

        .adu, .updated {
            color: #390;
        }
    }
}

.secondary {
    .hovercard.addon {
        line-height: 1.3;
        width: 196px;
        position: relative;
        left: -8px;
        border: 0;
        margin: 0;

        .icon {
            float: left;
            position: static;
            left: auto;
            right: auto;
            border: 0;
        }
        .summary a, p {
            padding: 0;
        }
        .summary a {
            display: inline;
        }
        &:before {
            content: none;
        }
    }
}
.html-rtl .listing-grid {
    li {
        float: right;
    }
    .hovercard {
        &.addon {
            margin: 5px 61px 5px 5px;
        }
        .more {
            padding: 0 12px 8px 14px;
        }
        .icon {
            left: auto;
            right: -57px;
            padding-left: 0;
            padding-right: 8px;
            border-width: 1px 1px 1px 0;
        }
        &:before {
            left: auto;
            right: -57px;
        }
    }
    .addon:hover {
        float: right;
    }
    &.featured, &.theme-grid {
        .hovercard.addon {
            margin: 0;

            &:hover .more {
                padding: 14px 0 0;
            }
        }
    }
}

.hovercard .install-shell .d2c-reasons-help {
    display: none;
}
